﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Kaidou.Model
{
    public class LoginModel
    {
        public static readonly string STATUS_NORMAL = "10";
	    public static readonly string STATUS_DELETE = "99";

	    public static readonly string USER_CLSS_KUMIAIIN = "10";
	    public static readonly string USER_CLSS_JIMUKYOKU = "20";
	    public static readonly string USER_CLSS_OPERATOR = "30";

	    public static readonly string CANCEL_REST_FLG_NORMAL = "0";
	    public static readonly string CANCEL_REST_FLG_FORCE = "1";

	    public static readonly string PASS_CHANGE = "1";

        string userID;

        public string UserID
        {
            get { return userID; }
            set { userID = value; }
        }

        string unioncode;

        public string Unioncode
        {
            get { return unioncode; }
            set { unioncode = value; }
        }

        int branchcode;

        public int Branchcode
        {
            get { return branchcode; }
            set { branchcode = value; }
        }

       
        string password;

        public string Password
        {
            get { return password; }
            set { password = value; }
        }

        string name;

        public string Name
        {
            get { return name; }
            set { name = value; }
        }

        string userclss;

        public string Userclss
        {
          get { return userclss; }
          set { userclss = value; }
        }

        string parentOfficeName;

        public string ParentOfficeName
        {
            get { return parentOfficeName; }
            set { parentOfficeName = value; }
        }

        string officeName;

        public string OfficeName
        {
            get { return officeName; }
            set { officeName = value; }
        }

        string officeTanto;

        public string OfficeTanto
        {
            get { return officeTanto; }
            set { officeTanto = value; }
        }

        string Office_zip_no1;

        public string Office_zip_no11
        {
            get { return Office_zip_no1; }
            set { Office_zip_no1 = value; }
        }

        string Office_zip_no2;

        public string Office_zip_no21
        {
            get { return Office_zip_no2; }
            set { Office_zip_no2 = value; }
        }

        string Office_pref;

        public string Office_pref1
        {
            get { return Office_pref; }
            set { Office_pref = value; }
        }


        string Office_city;

        public string Office_city1
        {
            get { return Office_city; }
            set { Office_city = value; }
        }

        string Office_address;

        public string Office_address1
        {
            get { return Office_address; }
            set { Office_address = value; }
        }

        string Office_tel;

        public string Office_tel1
        {
            get { return Office_tel; }
            set { Office_tel = value; }
        }

        string Office_fax;

        public string Office_fax1
        {
            get { return Office_fax; }
            set { Office_fax = value; }
        }

        MstUnion parent;

        public MstUnion Parent
        {
            get { return parent; }
            set { parent = value; }
        }

        string officeEmail;

        public string OfficeEmail
        {
            get { return officeEmail; }
            set { officeEmail = value; }
        }


        /**
	     * ユーザー区分が組合員かどうかを調べる
	     * @return boolean 組合員であればTrue/そうでなければFalse
	     */
	    public bool isKumiaiin() {
		    if (USER_CLSS_KUMIAIIN.Equals(this.userclss)) {
			    return true;
		    }
		    return false;
	    }

	    /**
	     * ユーザー区分が事務局かどうかを調べる
	     * @return boolean 事務局であればTrue/そうでなければFalse
	     */
	    public bool isJimukyoku() {
            if (USER_CLSS_JIMUKYOKU.Equals(this.userclss))
            {
			    return true;
		    }
		    return false;
	    }

	    /**
	     * ユーザー区分がオペレータかどうかを調べる
	     * @return boolean オペレータであればTrue/そうでなければFalse
	     */
	    public bool isOperator() {
            if (USER_CLSS_OPERATOR.Equals(this.userclss))
            {
			    return true;
		    }
		    return false;
	    }

	    /**
	     * 支店コードが本店かどうかを調べる
	     * @return boolean 本店であればTrue/そうでなければFalse
	     */
	    public bool isHonten() {
		    if (this.branchcode == 0) {
			    return true;
		    }
		    return false;
	    }

	    /**
	     * 支店コードが支店かどうかを調べる
	     * @return boolean 支店であればTrue/そうでなければFalse
	     */
	    public bool isShiten() {
		    if (this.branchcode > 0 && this.branchcode < 900) {
			    return true;
		    }
		    return false;
	    }

	    /**
	     * 支店コードが他業者かどうかを調べる
	     * @return boolean 他業者であればTrue/そうでなければFalse
	     */
	    public bool isTagyousha() {
            if (this.branchcode >= 900)
            {
			    return true;
		    }
		    return false;
	    }


    }
}
